/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package web;

import core.SuperSchool;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;

/**
 *
 * @author Anton
 */
public class SuperSchoolUserObject extends NodeUserObject
{
    public static final int rootTreeType = 0;
    public static final int schoolTreeType = 1;
    public static final int schoolListTreeType = 2;
    public static final int programTreeType = 3;
    public static final int programListTreeType = 4;
    public static final int courseTreeType = 5;
    public static final int courseUnderProgramTreeType = 6;
    public static final int courseListTreeType = 7;
    public static final int bookTreeType = 8;

    private SuperSchool treeObject;
    private int treeType;
    private int treeId;
    private TreeNode[] path;

    public SuperSchoolUserObject(DefaultMutableTreeNode defaultMutableTreeNode, int treeType, int treeId, TreeNode[] path)
    {
        super(defaultMutableTreeNode);
        this.treeType = treeType;
        this.treeId = treeId;
        this.path = path;
    }

    public SuperSchool getTreeObject()
    {
        return treeObject;
    }

    public void setTreeObject(SuperSchool treeObject)
    {
        this.treeObject = treeObject;
    }

    public int getTreeType()
    {
        System.out.println("Type: " + treeType);
        return treeType;
    }

    public void setTreeType(int treeType)
    {
        this.treeType = treeType;
    }

    public int getTreeId()
    {
        return treeId;
    }

    public void setTreeId(int treeId)
    {
        this.treeId = treeId;
    }

    public TreeNode[] getPath()
    {
        return path;
    }

    public void setPath(TreeNode[] path)
    {
        this.path = path;
    }

    public boolean getRootTreeType()
    {
        return isTreeType(rootTreeType);
    }

    public boolean getSchoolTreeType()
    {
        return isTreeType(schoolTreeType);
    }

    public boolean getSchoolListTreeType()
    {
        return isTreeType(schoolListTreeType);
    }

    public boolean getProgramTreeType()
    {
        return isTreeType(programTreeType);
    }

    public boolean getProgramListTreeType()
    {
        return isTreeType(programListTreeType);
    }

    public boolean getCourseTreeType()
    {
        return isTreeType(courseTreeType);
    }

    public boolean getCourseUnderProgramTreeType()
    {
        return isTreeType(courseUnderProgramTreeType);
    }

    public boolean getCourseListTreeType()
    {
        return isTreeType(courseListTreeType);
    }

    public boolean getBookTreeType()
    {
        return isTreeType(bookTreeType);
    }

    private boolean isTreeType(int treeType)
    {
        return this.treeType == treeType;
        
    }
}
